{include file="public/head" /}
<body>
    {include file="public/menu" /}
    <div class="member">
        <div class="wrap">
            {include file="public/left" /}
            <div class="security">
                <div class="head commonTab">
                    <div>
                        <a  href="{:url('Member/info')}">个人资料</a>
                        <a class="ac" href="{:url('Member/safe')}">安全中心</a>
                        <a href="{:url('Member/card')}">银行卡</a>
                    </div>
                </div>
                <div class="safe">
                    <div class="block">
                        <div class="item">
                            <div class="tip">
                                <div class="imgicon"><img src="/static/hry/images/idcard.png" alt=""></div>身份证</div>
                            <div class="info">{:PutPrivateNumber($member.certificate)}</div>
                        </div>
                    </div>
                    <div class="block">
                        <div class="item">
                            <div class="tip">
                                <div class="imgicon"><img src="/static/hry/images/ath-phone.png" alt=""></div>认证手机</div>
                            <div class="info">{:getXXtel($member.yunmobile)}<span>涉及您的银行卡更绑，作品支持等业务，请妥善保管。</span></div>
                                {if condition="$member.safeMobile eq 1"}
                                <a href="javascript:;" class="btn" id="change-mobile">修改认证手机</a>
                                {else /}
                                <a href="javascript:;" class="btn" id="btn-mobile">认证手机号</a>
                                {/if}
                        </div>
                    </div>
                    <div class="block">
                        <div class="item">
                            <div class="tip"><div class="imgicon"><img src="/static/hry/images/ath-phone.png" alt=""></div>登录手机</div>
                            <div class="info">{:getXXtel($member.mobile)}<span>用于登录账号使用，请妥善保管。</span></div>
                            <a href="javascript:;" class="btn" id="change-login-mobile">修改登录手机</a>
                        </div>
                    </div>
                    <div class="block">
                        <div class="item">
                            <div class="tip"><div class="imgicon"><img src="/static/hry/images/paypsw.png" alt=""></div>支付密码</div>
                            <div class="info">密码涉及您的财务安全，请妥善保管</div>
                            {if condition="$member.pay_password"}
                            <a href="javascript:;" class="btn" id="change-pay-password">重置支付密码</a>
                            {else/}
                            <a href="javascript:;" class="btn" id="change-pay-password">设置支付密码</a>
                            {/if}
                        </div>
                    </div>
                    <div class="block">
                        <div class="item">
                            <div class="tip"><div class="imgicon"><img src="/static/hry/images/login-psw.png" alt=""></div>登录密码</div>
                            <div class="info">上次登录时间（{:date('Y-m-d H:i:s',$member.last2_time ? $member.last2_time : time())}）</div>
                            <a href="javascript:;" class="btn" id="change-login-password">修改登录密码</a>
                        </div>
                    </div>
                </div>
                <div class="alert" id="alertbox">
                    <div class="mask" id="mask"></div>
                    <div class="box">
                        <h2>修改密码</h2>
                        <form action="" id="ChangFrom" onSubmit="return false;">
                            <div class="commonAlertBox password">
                                <input type="password" name="oldpass" placeholder="确认旧密码" id="oldpass">
                            </div>
                            <div class="commonAlertBox password">
                                <input type="password" name="newpass" placeholder="请输入新密码" id="cipher">
                            </div>
                            <div class="commonAlertBox password">
                                <input type="password" placeholder="请确认密码" id="sure-cipher">
                            </div>
                            <input type="submit" value="确认" onclick="checkInfo()">
                        </form>
                        <div class="err" id="err"></div>
                    </div>
                </div>

                <div class="alert" id="changesafemobile">
                    <div class="mask" id="mask2"></div>
                    <div class="box">
                        <h2>手机验证</h2>
                        <form action="" onSubmit="return false;">
                            <div class="commonAlertBox newmobilebox mobile" id="newPhone">
                                <input type="text" class="newmobile" value=""  id="newMobile" placeholder="请输入您的新手机号"/>
                            </div>
                            <div class="commonAlertBox password">
                                <input type="text" placeholder="验证码" id="YunCode" style="width: 50%;display: inline;">
                                <input type="button" id="getcode" onclick="GetYsCode(getcode)" value="获取验证码" style="width: 45%;display: inline;float:right;cursor:pointer;">
                            </div>
                            <input type="submit" value="确认" onclick="checkInfo2(getcode)">
                        </form>
                        <div class="err" id="err"></div>
                    </div>
                </div>

                <div class="alert" id="unbindMobile">
                    <div class="mask" id="mask5"></div>
                    <div class="box">
                        <h2>解绑手机</h2>
                        <form action="" onSubmit="return false;">
                            <div class="commonAlertBox oldmobilebox mobile">
                                <input type="text" value="{$member.yunmobile}" id="oldSendMobile" class="oldSendMobile"/>
                            </div>
                            <div class="commonAlertBox password">
                                <input type="text" placeholder="验证码" id="unbindCode" style="width: 50%;display: inline;">
                                <input type="button" id="unbindGetcode" onclick="{if condition = '$member.safeMobile eq 1'}unbindGetYsCode2(unbindGetcode){/if}" value="获取验证码" style="width: 45%;display: inline;float:right;cursor:pointer;">
                            </div>
                            <input type="submit" value="下一步" onclick="{if condition = '$member.safeMobile eq 1'}unbindCheckInfo21(unbindGetcode){/if}">
                        </form>
                        <div class="err" id="err"></div>
                    </div>
                </div>

                <div class="alert" id="alertbox3">
                    <div class="mask" id="mask3"></div>
                    <div class="box">
                        <h2>支付密码</h2>
                        <form action="" onSubmit="return false;">
                            <div class="commonAlertBox password">
                                <input type="password" placeholder="请输入新密码" id="newpaypass">
                            </div>
                            <div class="commonAlertBox password">
                                <input type="password" placeholder="请确认密码" id="sure-newpaypass">
                            </div>
                            <div class="commonAlertBox password" id='getpiccode'>
                                <input type="text" class="recharge-amount amount1" id="txcode" placeholder="图形验证码" />
                                <img src="{:captcha_src()}" id="code" alt="captcha" onclick="this.src = '{:captcha_src()}?rnd=' + Math.random();" />
                            </div>
                            <div class="commonAlertBox password">
                                <input type="text" placeholder="验证码" id="PayCode" style="width: 50%;display: inline;">
                                <input type="button" id="getcode2" onclick="getPayCode(getcode2)" value="获取验证码" style="width: 45%;display: inline;float:right;cursor:pointer;">
                            </div>
                            <input type="submit" value="确认" onclick="checkInfo3()">
                        </form>
                        <div class="err" id="err"></div>
                    </div>
                </div>
                <!--todo 修改登录手机号的表单-->
                <div class="alert" id="changelmbox">
                    <div class="mask" id="mask4"></div>
                    <div class="box">
                        <h2>修改登录手机</h2>
                        <form action="" onSubmit="return false;">
                            <div class="commonAlertBox mobile">
                                <input type="text" value="{$member.mobile}" readonly="readonly" id="loldMobile"/>
                            </div>
                            <div class="commonAlertBox password"  style="display:none;" id="lnewmobile">
                                <input type="text" value=""  id="lnewmobilev" placeholder="旧手机号"/>
                            </div>
                            <div class="commonAlertBox">
                                <input type="text" placeholder="验证码" id="lYunCode" style="width: 50%;display: inline;">
                                <input type="button" id="lgetcode" onclick="GetYsCode3(lgetcode)" value="获取验证码" style="width: 45%;display: inline;float:right;cursor:pointer;">
                            </div>
                            <div>
                                <p>&nbsp</p>
                                <!--todo 修改style.css 4030-->
                                <font size="2" style="margin-left:100px;color:rgb(130,130,130)">注:&nbsp;&nbsp;&nbsp;更绑后原账号手机将被注销使用</font>
                            </div>
                            <div class="noticetxt">
                                <!--todo 修改style.css 4030-->
                                <p onclick="changemobile()">旧手机已停用？点击此处修改账号</p>
                            </div>

                            <input type="submit" class="sdnew" value="账号验证" onclick="checkInfo31(lgetcode)">
                        </form>
                        <div class="err" id="lerr"></div>
                    </div>
                </div>
                <!--todo 手机号停用后换号表单-->
                <div class="alert" id="changeflmbox">
                    <div class="mask"></div>
                    <div class="box">
                        <h2>实名更绑登录手机</h2>
                        <form action="" onSubmit="return false;">
                            <div class="commonAlertBox password">
                                <input type="text" value="" class="username" placeholder="实名用姓名" />
                            </div>
                            <div class="commonAlertBox password" >
                                <input type="text" value="" class="idcard"  placeholder="实名身份证号"/>
                            </div>
                            <div class="commonAlertBox password" >
                                <input type="text" value="" class="newmobile"  placeholder="新手机号"/>
                            </div>
                            <div class="commonAlertBox password">
                                <input type="text" class="code" placeholder="验证码"  style="width: 50%;display: inline;">
                                <input type="button"  onclick="GetYsCode4(lmgetcod)" id="lmgetcod" value="获取验证码" style="width: 45%;display: inline;float:right;cursor:pointer;">
                            </div>
                            <input type="submit" class="sdnew" value="确定" onclick="checkInfo41(lmgetcod)">
                        </form>
                        <div class="err"></div>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    {include file="public/foot"}
</body>
{include file="public/load_bottom" /}
<script>
                            $(function(){
                            $('#change-login-password').click(function () {
                            $('#alertbox').fadeIn(300)
                                    $('body').css('overflowY', 'hidden')
                            });
                                    $('.mask').click(function () {
                            var parentnode = $(this).parent();
                                    parentnode.fadeOut(300);
                                    // countdown=60;
                                    $('body').css('overflowY', 'visible')
                            });
                                    $('#btn-mobile').click(function(){
                            if ({$member.is_check} == 1){
                            $('#changesafemobile').fadeIn(300)
                                    $('body').css('overflowY', 'hidden')
                            } else{
                            layer.msg('请先完成实名认证');
                            }
                            });
                                    $('#change-pay-password').click(function(){
                            if ({$member.safeMobile} == 1){
                            $('#alertbox3').fadeIn(300);
                                    $('body').css('overflowY', 'hidden')
                            } else{
                            layer.msg('请先认证手机号');
                            }
                            });

                                    $("#change-mobile").click(function(){
                            // $('#changesafemobile').fadeIn(300);
                            $('#unbindMobile').fadeIn(300);
                                    var oldmobile = $('#changesafemobile').find('.oldmobile');
                                    // var newmobilebox = $('#changesafemobile').find('.newmobilebox');
                                    oldmobile.attr("disabled", "disabled");
                                    // newmobilebox.show();
                                    $('body').css('overflowY', 'hidden')
                            });

                                    $("#change-login-mobile").click(function(){
                            $('#changelmbox').fadeIn(300)
                                    $('#sendMobile').attr("disabled", "disabled");
                                    $("#newPhone").show();
                                    $('body').css('overflowY', 'hidden')
                            })
                            })
                            function checkInfo() {
                            var oldpass = $('#oldpass')
                                    var cipher = $('#cipher')
                                    var surecipher = $('#sure-cipher')
                                    var err = $('#err')
                                    var reg = /^[0-9]+.?[0-9]*$/;
                                    if (oldpass.val() == ''){
                            err.text('请输入旧密码！')
                                    err.fadeIn(300)
                                    setTimeout(function () {
                                    err.fadeOut(300)
                                    }, 1000)
                                    oldpass.focus()
                                    return false
                            }
                            if (cipher.val().length < 6){
                            err.text('新密码不能少于6位！')
                                    err.fadeIn(300)
                                    setTimeout(function () {
                                    err.fadeOut(300)
                                    }, 1000)
                                    cipher.focus()
                                    return false
                            }
                            else if (reg.test(cipher.val())){
                            err.text('密码不能为纯数字')
                                    err.fadeIn(300)
                                    setTimeout(function () {
                                    err.fadeOut(300)
                                    }, 1000)
                                    cipher.focus()
                                    return false
                            }
                            else if (surecipher.val() == ''){
                            err.text('请确认密码！')
                                    err.fadeIn(300)
                                    setTimeout(function () {
                                    err.fadeOut(300)
                                    }, 1000)
                                    surecipher.focus()
                                    return false
                            }
                            if (cipher.val() != surecipher.val()){
                            err.text('两次密码输入不一致！')
                                    err.fadeIn(300)
                                    setTimeout(function () {
                                    err.fadeOut(300)
                                    }, 1000)
                                    surecipher.focus()
                                    return false
                            }
                            var fromData = $("#ChangFrom").serialize();
                                    $.ajax({
                                    url:"{:url('Member/logpass')}",
                                            type:"POST",
                                            dataType:"JSON",
                                            data:fromData,
                                            success:function(msg){
                                            err.text(msg.info);
                                                    err.fadeIn(300)
                                                    setTimeout(function(){
                                                    err.fadeOut(300)
                                                            if (msg.status == 1){
                                                    $('#mask').click();
                                                    }
                                                    }, 1000)
                                                window.location.href="{:url('login/index')}";
                                            }
                                    })
                            }

                    function GetYsCode(obj){
                    var sendMobile = $('#newMobile').val();
                            var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/;
                            if (!phoneReg.test(sendMobile)){
                    layer.msg('请输入正确的手机号', {time:1000});
                            return false;
                    }
                    settime(obj);
                            $.ajax({
                            url:"{:url('Yun/SendYsCode')}",
                                    type:"POST",
                                    dataType:"JSON",
                                    data:{newmobile:sendMobile},
                                    success:function(msg){
                                    layer.msg(msg.info);
                                            if (msg.status != 1){
                                    settime(obj, 0);
                                    }
                                    }
                            })
                    }

                    function GetYsCode2(obj){
                    var newMobile = $(obj).parent().siblings(".newmobilebox").find('.newmobile').val();
                            var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/;
                            if (!phoneReg.test(newMobile)){
                    layer.msg('请输入正确的手机号', {time:1000});
                            return false;
                    }
                    settime(obj);
                            $.ajax({
                            url:"{:url('Yun/SendYsCode')}",
                                    type:"POST",
                                    dataType:"JSON",
                                    data:{newmobile:newMobile},
                                    success:function(msg){
                                    layer.msg(msg.info);
                                            if (msg.status != 1){
                                    settime(obj, 0)
                                    }
                                    }
                            })
                    }


                            function unbindGetYsCode2(obj){
                                var newMobile = $(obj).parent().siblings(".oldmobilebox").find('.oldSendMobile').val();
                                var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/;
                                if (!phoneReg.test(newMobile)){
                                    layer.msg('请输入正确的手机号', {time:1000});
                                    return false;
                                }
                                settime(obj);
                                $.ajax({
                                    url:"{:url('yun/SendUnbindMobileCode')}",
                                    type:"POST",
                                    dataType:"JSON",
                                    data:{mobile:newMobile},
                                    success:function(msg){
                                        layer.msg(msg.info);
                                        if (msg.status != 1){
                                            settime(obj, 0)
                                        }
                                    }
                                })
                            }


                    function checkInfo2(){
                    var sendMobile = $('#newMobile').val();
                            var code = $('#YunCode').val();
                            if (code == ''){
                    layer.msg('请输入验证码');
                            return false;
                    }

                    $.ajax({
                    url:"{:url('Yun/bindMobile')}",
                            type:"POST",
                            dataType:"JSON",
                            data:{mobile:sendMobile, code:code},
                            success: function(msg){
                            layer.msg(msg.info);
                                    if (msg.status == 1){
                            setTimeout(function(){
                            window.location.href = msg.url;
                            }, 2000)
                            }
                            }
                    })
                    }

                    function checkInfo21(){
                    var sendMobile = $('#sendMobile').val();
                            var newMobile = $("#newMobile").val();
                            var code = $('#YunCode').val();
                            var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/;
                            if (!phoneReg.test(newMobile)){
                    layer.msg('请输入正确的手机号', {time:1000});
                            return false;
                    }

                    if (code == ''){
                    layer.msg('请输入验证码');
                            return false;
                    }
                    $.ajax({
                    url:"{:url('Yun/bindMobile2')}",
                            type:"POST",
                            dataType:"JSON",
                            data:{mobile:sendMobile, newmobile:newMobile, code:code},
                            success: function(msg){
                            layer.msg(msg.info);
                                    if (msg.status == 1){
                            setTimeout(function(){
                            window.location.href = msg.url;
                            }, 2000)
                            }
                            }
                    })
                    }


                            function unbindCheckInfo21(){
                                var sendMobile = $('#oldSendMobile').val();
                                var code = $('#unbindCode').val();
                                var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/;
                                if (!phoneReg.test(sendMobile)){
                                    layer.msg('请输入正确的手机号', {time:1000});
                                    return false;
                                }

                                if (code == ''){
                                    layer.msg('请输入验证码');
                                    return false;
                                }
                                $.ajax({
                                    url:"{:url('yun/unBindMobile')}",
                                    type:"POST",
                                    dataType:"JSON",
                                    data:{mobile:sendMobile, code:code},
                                    success: function(msg){
                                        layer.msg(msg.info);
                                        $('#unbindMobile').fadeOut(300)
                                        $('#changesafemobile').fadeIn(300)
                                    }
                                })
                            }


                    function checkInfo3(){
                    var reg = /^\d{6}$/;
                            var newpaypass = $('#newpaypass').val();
                            var sure_newpaypass = $('#sure-newpaypass').val();
                            var PayCode = $('#PayCode').val();
                            if (!reg.test(newpaypass)){
                    layer.msg('请输入6位纯数字支付密码');
                            return false;
                    }
                    if (newpaypass != sure_newpaypass){
                    layer.msg('两次密码输入不一致');
                            return false;
                    }
                    if (PayCode == ''){
                    layer.msg('请输入短信验证码');
                            return false;
                    }
                    $.ajax({
                    url:"{:url('Yun/setPayPass')}",
                            type:"POST",
                            dataType:"JSON",
                            data:{pwd:newpaypass, code:PayCode},
                            success: function(msg){
                            layer.msg(msg.info);
                                    if (msg.status == 1){
                            setTimeout(function(){
                            window.location.href = msg.url;
                            }, 2000)
                            }
                            }
                    })
                    }

                    function getPayCode(obj){
                    var txcode = $('#txcode').val();
                            if (txcode == ''){
                    layer.msg('请输入图形验证码');
                            return false;
                    }
                    settime(obj);
                            $.ajax({
                            url:"{:url('Yun/getPayCode')}",
                                    type:"POST",
                                    dataType:"JSON",
                                    data:{txcode:txcode},
                                    success:function(msg){
                                    layer.msg(msg.info);
                                            if (msg.status != 1){
                                    settime(obj, 0)
                                    }
                                    }
                            })
                    }

                    var countdown = 60;
                            let timer = null
                            function settime(obj, countdown){
                            // var val = $("#getcode");
                            if ('undefined' == typeof (countdown)){
                            countdown = 60
                            }
                            var val = $(obj);
                                    if (countdown == 0) {
                            val.attr('disabled', false)
                                    val.val("获取验证码");
                                    if (timer) {
                            clearTimeout(timer)
                            }
                            // countdown = 60;
                            } else {
                            val.attr('disabled', true)
                                    val.val(countdown + "s");
                                    countdown--;
                                    timer = setTimeout(function() {
                                    settime(obj, countdown)
                                    }, 1000)
                            }

                            }

                    var countdown2 = 60;
                            function settime2(){
                            var val = $("#getcode2");
                                    if (countdown2 == 0) {
                            val.attr('disabled', false)
                                    val.val("获取验证码");
                                    countdown2 = 60;
                            } else {
                            val.attr('disabled', true)
                                    val.val(countdown2 + "s");
                                    countdown2--;
                                    setTimeout(function() {
                                    settime2()
                                    }, 1000)
                            }

                            }

                    //todo 修改登录手机号获取验证码
                    function GetYsCode3(obj){
                    var oldMobile = $("#loldMobile").val();
                            var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/;
                            if (!phoneReg.test(oldMobile)){
                    layer.msg('请输入正确的手机号', {time:1000});
                            return false;
                    }
                    settime(obj);
                            $.ajax({
                            url:"{:url('Member/sendcode1')}", //todo 云片网验证码
                                    type:"POST",
                                    dataType:"JSON",
                                    data:{mobile:oldMobile},
                                    success:function(msg){
                                    layer.msg(msg.info);
                                            if (msg.status != 1){
                                    settime(obj, 0)
                                    }
                                    }
                            })
                    }

                    //todo 修改登录手机号验证原手机号
                    let clp = 0;
                            function checkInfo31(obj){
                            if (clp == 0){
                            var url = "{:url('member/updatemobile')}";
                            } else{
                            var url = "{:url('member/updatemember')}";
                            }
                            var mobile = $('#loldMobile').val();
                                    var code = $('#lYunCode').val();
                                    var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/;
                                    if (!phoneReg.test(mobile)){
                            layer.msg('请输入正确的手机号', {time:1000});
                                    return false;
                            }
                            if (code == ''){
                            layer.msg('请输入验证码');
                                    return false;
                            }
                            $.ajax({
                            url:url, //todo 验证手机号是否正确
                                    type:"POST",
                                    dataType:"JSON",
                                    data:{mobile:mobile, code:code},
                                    success: function(msg){
                                    layer.msg(msg.info);
                                            if (msg.status == 1){
                                    setTimeout(function(){
                                    window.location.href = msg.url;
                                    }, 2000)
                                    } else{
                                    if (msg.status == 0 && clp == 0){
                                    clp = 1;
                                            countdown = 0;
                                            settime(obj, 0)
                                            $('#loldMobile').attr('placeholder', '请输入新的手机号');
                                            $('#loldMobile').removeAttr("value");
                                            $('#loldMobile').removeAttr("readonly");
                                            $('#lYunCode').val('');
                                            $('#changelmbox').find('.sdnew').val('确定更改');
                                    }
                                    }
                                    }
                            })
                            }
                    //通过实名信息修改手机号
                    function changemobile() {
                    var parentnode = $(this).parent();
                            $('#changeflmbox').fadeIn(300)
                            // $('body').css('overflowY','visible')
                            $('#changelmbox').fadeOut(300)
                            // $('body').css('overflowY','hidden')
                    }
                    //获取验证码
                    function GetYsCode4(obj){
                    var mobile = $("#changeflmbox").find('.newmobile').val();
                            var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/;
                            if (!phoneReg.test(mobile)){
                    layer.msg('请输入正确的手机号', {time:1000});
                            return false;
                    }
                    settime(obj);
                            $.ajax({
                            url:"{:url('Member/sendcode1')}", //todo 云片网验证码
                                    type:"POST",
                                    dataType:"JSON",
                                    data:{mobile:mobile},
                                    success:function(msg){
                                    layer.msg(msg.info);
                                            if (msg.status != 1){
                                    settime(obj, 0)
                                    }
                                    }
                            })
                    }

                    function checkInfo41(obj){

                    var mobile = $("#changeflmbox").find('.newmobile').val();
                            var idcard = $("#changeflmbox").find('.idcard').val();
                            var username = $("#changeflmbox").find('.username').val();
                            var code = $("#changeflmbox").find('.code').val();
                            var nameReg = /^(^[\u4e00-\u9fa5]{1,10})(·|·([\u4e00-\u9fa5]*·)|)[\u4e00-\u9fa5]{1,10}$/;
                            var idcardReg = /(^\d{15}$)|(^\d{17}([0-9]|X|x)$)/;
                            console.log(code);
                            var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/;
                            if (!phoneReg.test(mobile)){
                    layer.msg('请输入正确的手机号', {time:1000});
                            return false;
                    }
                    if (code == ''){
                    layer.msg('请输入验证码');
                            return false;
                    }
                    if (!nameReg.test(username)){
                    layer.msg('请输入正确的姓名');
                            return false;
                    }
                    if (!idcardReg.test(idcard)){
                    layer.msg('请输入正确的身份证号', {time:1000});
                            return false;
                    }
                    var url = "{:url('member/findmobile')}";
                            $.ajax({
                            url:url, //todo 验证手机号是否正确
                                    type:"POST",
                                    dataType:"JSON",
                                    data:{mobile:mobile, idcard:idcard, username:username, code:code},
                                    success: function(msg){
                                    layer.msg(msg.info);
                                            if (msg.status == 1){
                                    setTimeout(function(){
                                    window.location.href = msg.url;
                                    }, 2000)
                                    }
                                    }
                            })
                    }



</script>
</html>